/*
MySQL Backup
Database: order_system
Backup Time: 2022-04-28 17:27:23
*/

SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `order_system`.`food`;
DROP TABLE IF EXISTS `order_system`.`food_type`;
DROP TABLE IF EXISTS `order_system`.`sys_role`;
DROP TABLE IF EXISTS `order_system`.`sys_user`;
DROP TABLE IF EXISTS `order_system`.`sys_user_role`;
CREATE TABLE `food` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL COMMENT '菜品名称',
  `food_type_id` int NOT NULL COMMENT '菜品类型id',
  `img` varchar(255) DEFAULT NULL COMMENT '菜品图片地址',
  `price` float(10,2) NOT NULL COMMENT '菜品价格',
  `price_unit` varchar(255) NOT NULL COMMENT '价格单位',
  `remark` varchar(5000) DEFAULT NULL COMMENT '菜品描述',
  `is_hot` int NOT NULL DEFAULT '0' COMMENT '是否招牌 默认0：否，1：是',
  `is_discount` int NOT NULL DEFAULT '0' COMMENT '是否折扣 默认0：否，1：是',
  `is_del` int NOT NULL DEFAULT '0' COMMENT '是否删除 默认0：否，1：是',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=utf8mb3;
CREATE TABLE `food_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL COMMENT '菜品类别名称',
  `user_id` int NOT NULL COMMENT '商家id',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `is_del` int NOT NULL DEFAULT '0' COMMENT '是否删除 默认0：否，1：是',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3;
CREATE TABLE `sys_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL COMMENT '权限名称',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;
CREATE TABLE `sys_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL COMMENT '商家名称',
  `sex` varchar(4) DEFAULT NULL COMMENT '性别',
  `email` varchar(50) NOT NULL COMMENT '电子邮件',
  `phone` varchar(15) NOT NULL COMMENT '电话（登录标识）',
  `password` varchar(255) NOT NULL COMMENT '密码（登录凭证）',
  `shop_logo` varchar(255) DEFAULT NULL COMMENT '店铺logo',
  `shop_name` varchar(255) NOT NULL COMMENT '店铺名称',
  `shop_address` varchar(255) DEFAULT NULL COMMENT '店铺地址',
  `QR_url` varchar(255) DEFAULT NULL COMMENT '菜单列表二维码',
  `salt` varchar(255) NOT NULL,
  `is_del` int NOT NULL DEFAULT '0' COMMENT '是否删除 默认0：否，1：是',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3;
CREATE TABLE `sys_user_role` (
  `user_id` int NOT NULL COMMENT '用户id',
  `role_id` int NOT NULL COMMENT '权限id',
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
BEGIN;
LOCK TABLES `order_system`.`food` WRITE;
DELETE FROM `order_system`.`food`;
INSERT INTO `order_system`.`food` (`id`,`name`,`food_type_id`,`img`,`price`,`price_unit`,`remark`,`is_hot`,`is_discount`,`is_del`,`create_time`,`update_time`) VALUES (1, '牛肉串', 1, '00ccf37a21b4403fb3d5f9d21657db02.jpg', 5.00, '串', '上传图片测试', 1, 0, 0, '2022-04-24 03:15:43', '2022-04-24 03:15:43'),(2, '羊肉串', 1, '', 5.00, '串', '', 1, 0, 0, '2022-04-24 03:20:30', '2022-04-24 03:20:30'),(3, '排骨', 1, '', 6.00, '串', '', 1, 0, 0, '2022-04-24 03:26:15', '2022-04-24 03:26:15'),(4, '秋刀鱼', 1, '', 7.00, '串', '', 0, 0, 0, '2022-04-24 05:49:49', '2022-04-24 05:49:49'),(5, '小黄鱼', 1, '', 4.00, '串', '', 0, 0, 0, '2022-04-24 05:51:05', '2022-04-24 05:51:05'),(6, '里脊', 1, '', 3.00, '串', '', 0, 0, 0, '2022-04-24 05:51:29', '2022-04-24 05:51:29'),(7, '鸡柳', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 05:51:46', '2022-04-24 05:51:46'),(8, '掌中宝', 1, '', 4.00, '串', '', 0, 0, 0, '2022-04-24 05:52:16', '2022-04-24 05:52:16'),(9, '卤鸡脚', 1, '', 6.00, '串', '', 0, 0, 0, '2022-04-24 05:52:36', '2022-04-24 05:52:36'),(10, '卤鸡尖', 1, '', 4.00, '串', '', 0, 0, 0, '2022-04-24 05:53:12', '2022-04-24 05:53:12'),(11, '鱿鱼须', 1, '', 6.00, '串', '', 0, 0, 0, '2022-04-24 05:53:32', '2022-04-24 05:53:32'),(12, '鱿鱼板', 1, '', 6.00, '串', '', 0, 0, 0, '2022-04-24 05:53:52', '2022-04-24 05:53:52'),(13, '猪脆骨', 1, '', 5.00, '串', '', 0, 0, 0, '2022-04-24 05:54:10', '2022-04-24 05:54:10'),(14, '鸡皮', 1, '', 3.00, '串', '', 0, 0, 0, '2022-04-24 05:54:23', '2022-04-24 05:54:23'),(15, '五花肉', 1, '', 3.00, '串', '', 0, 0, 0, '2022-04-24 05:54:40', '2022-04-24 05:54:40'),(16, '把把鸭肠', 1, '', 12.00, '把', '', 0, 0, 0, '2022-04-24 05:55:01', '2022-04-24 05:55:01'),(17, '把把鱿鱼', 1, '', 12.00, '把', '', 0, 0, 0, '2022-04-24 05:55:17', '2022-04-24 05:55:17'),(18, '鸡胗', 1, '', 4.00, '串', '', 0, 0, 0, '2022-04-24 05:55:35', '2022-04-24 05:55:35'),(19, '鸡中翅', 1, '', 8.00, '串', '', 0, 0, 0, '2022-04-24 05:55:51', '2022-04-24 05:55:51'),(20, '螃蟹', 1, '', 6.00, '串', '', 0, 0, 0, '2022-04-24 05:57:33', '2022-04-24 05:57:33'),(21, '鸽肚', 1, '', 5.00, '串', '', 0, 0, 0, '2022-04-24 05:57:49', '2022-04-24 05:57:49'),(22, '炸鹌鹑蛋', 1, '', 3.00, '串', '', 0, 0, 0, '2022-04-24 05:58:11', '2022-04-24 05:58:11'),(23, '热狗', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 05:58:34', '2022-04-24 05:58:34'),(24, '美好火腿肠', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 05:59:08', '2022-04-24 05:59:08'),(25, '鱼排', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 05:59:26', '2022-04-24 05:59:26'),(26, '蚂蚱', 1, '', 3.00, '串', '', 0, 0, 0, '2022-04-24 05:59:39', '2022-04-24 05:59:39'),(27, '小蚕蛹', 1, '', 3.00, '串', '', 0, 0, 0, '2022-04-24 05:59:52', '2022-04-24 05:59:52'),(28, '大青虾', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 06:00:05', '2022-04-24 06:00:05'),(29, '把把甜肠', 1, '', 8.00, '把', '', 0, 0, 0, '2022-04-24 06:00:21', '2022-04-24 06:00:21'),(30, '把把玉米', 1, '', 5.00, '把', '', 0, 0, 0, '2022-04-24 06:23:27', '2022-04-24 06:23:27'),(31, '韭菜', 1, '', 3.00, '串', '', 0, 0, 0, '2022-04-24 06:23:47', '2022-04-24 06:23:47'),(32, '四季豆', 1, '', 3.00, '串', '', 0, 0, 0, '2022-04-24 06:24:02', '2022-04-24 06:24:02'),(33, '豆干', 1, '', 3.00, '串', '', 0, 0, 0, '2022-04-24 06:24:14', '2022-04-24 06:24:14'),(34, '臭豆腐', 1, '', 3.00, '串', '', 0, 0, 0, '2022-04-24 06:24:26', '2022-04-24 06:24:26'),(35, '烤油馍', 1, '', 3.00, '串', '不加蒜蓉', 0, 0, 0, '2022-04-24 06:24:59', '2022-04-24 06:24:59'),(36, '南瓜饼', 1, '', 3.00, '个', '', 0, 0, 0, '2022-04-24 06:25:21', '2022-04-24 06:25:21'),(37, '千张', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 06:25:37', '2022-04-24 06:25:37'),(38, '娃娃菜', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 06:25:51', '2022-04-24 06:25:51'),(39, '金针菇', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 06:26:04', '2022-04-24 06:26:04'),(40, '魔芋(灰菜)', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 06:26:32', '2022-04-24 06:26:32'),(41, '青椒', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 06:27:13', '2022-04-24 06:27:13'),(42, '甜杆', 1, '', 2.00, '个', '', 0, 0, 0, '2022-04-24 06:27:58', '2022-04-24 06:27:58'),(43, '小馒头', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 06:28:12', '2022-04-24 06:28:12'),(44, '面筋', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 06:28:24', '2022-04-24 06:28:24'),(45, '烤薄饼', 1, '', 2.00, '个', '', 0, 0, 0, '2022-04-24 06:28:39', '2022-04-24 06:28:39'),(46, '苕皮', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 06:28:50', '2022-04-24 06:28:50'),(47, '土豆', 1, '', 2.00, '串', '', 0, 0, 0, '2022-04-24 06:29:01', '2022-04-24 06:29:01'),(48, '藕', 1, '', 1.00, '串', '', 0, 0, 0, '2022-04-24 06:29:14', '2022-04-24 06:29:14'),(49, '烤鲫鱼', 2, '', 38.00, '条', '', 1, 0, 0, '2022-04-24 06:31:11', '2022-04-24 06:31:11'),(50, '烤茄子', 2, '', 10.00, '个', '', 1, 0, 0, '2022-04-24 06:31:38', '2022-04-24 06:31:38'),(51, '蒜蓉油馍', 2, '', 4.00, '个', '', 1, 0, 0, '2022-04-24 06:31:55', '2022-04-24 06:31:55'),(52, '草鱼', 3, '', 68.00, '条', '配菜：金针菇、豆油皮、千张、娃娃菜（随机赠送两份）\n口味：香辣、麻辣、蒜香', 1, 0, 0, '2022-04-24 06:33:18', '2022-04-24 06:33:18'),(53, '钳鱼', 3, '', 78.00, '条', '配菜：金针菇、豆油皮、千张、娃娃菜（随机赠送两份）\n口味：香辣、麻辣、蒜香', 1, 0, 0, '2022-04-24 06:33:56', '2022-04-24 06:33:56'),(54, '锡纸粉丝', 4, '', 12.00, '份', '', 1, 0, 0, '2022-04-24 06:35:34', '2022-04-24 06:35:34'),(55, '锡纸娃娃菜', 4, '', 12.00, '份', '', 0, 0, 0, '2022-04-24 06:35:48', '2022-04-24 06:35:48'),(56, '锡纸鸭血', 4, '', 12.00, '份', '', 0, 0, 0, '2022-04-24 06:36:00', '2022-04-24 06:36:00'),(57, '锡纸金针菇', 4, '', 12.00, '份', '', 0, 0, 0, '2022-04-24 06:36:14', '2022-04-24 06:36:14'),(58, '香辣田螺', 5, '', 28.00, '份', '', 1, 0, 0, '2022-04-24 06:37:03', '2022-04-24 06:37:03'),(59, '爆炒花甲', 5, '', 38.00, '份', '', 0, 0, 0, '2022-04-24 06:37:25', '2022-04-24 06:37:25'),(60, '爆炒龙虾(小份)', 5, '', 58.00, '份', '', 0, 0, 0, '2022-04-24 06:37:49', '2022-04-24 06:37:49'),(61, '爆炒龙虾(大份)', 5, '', 88.00, '份', '', 0, 0, 0, '2022-04-24 06:38:11', '2022-04-24 06:38:11');
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `order_system`.`food_type` WRITE;
DELETE FROM `order_system`.`food_type`;
INSERT INTO `order_system`.`food_type` (`id`,`name`,`user_id`,`create_time`,`update_time`,`is_del`) VALUES (1, '特色烤串', 5, '2022-04-24 01:59:22', '2022-04-24 11:00:47', 0),(2, '特色烧烤', 5, '2022-04-24 02:58:15', '2022-04-24 11:00:56', 0),(3, '特色纸包鱼', 5, '2022-04-24 02:58:30', '2022-04-24 02:58:30', 0),(4, '特色锡纸', 5, '2022-04-24 02:58:38', '2022-04-24 02:58:38', 0),(5, '特色爆炒', 5, '2022-04-24 02:58:44', '2022-04-24 02:58:44', 0);
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `order_system`.`sys_role` WRITE;
DELETE FROM `order_system`.`sys_role`;
INSERT INTO `order_system`.`sys_role` (`id`,`name`,`remark`,`create_time`) VALUES (1, '管理员', '管理员', '2022-04-22 06:59:26'),(2, '商家', '普通用户', '2022-04-22 06:59:49');
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `order_system`.`sys_user` WRITE;
DELETE FROM `order_system`.`sys_user`;
INSERT INTO `order_system`.`sys_user` (`id`,`username`,`sex`,`email`,`phone`,`password`,`shop_logo`,`shop_name`,`shop_address`,`QR_url`,`salt`,`is_del`,`create_time`,`update_time`) VALUES (1, '管理员', NULL, '1829924804@qq.com', '18398924574', '1b8e1825ff0039162046fdf246beef63', NULL, '管理员', NULL, NULL, '860211624aa34d2e92aad269cc3d3034', 0, '2022-04-22 09:14:24', '2022-04-22 09:14:24'),(5, '杨青山', '男', '843829191@qq.com', '13980295804', '7de25ece995c946ce6e94a30a307d950', NULL, '蜀味烧烤', '南江县大河镇小学正对面', NULL, '23d7f2de934e421a9b45e6c33330e106', 0, '2022-04-24 01:35:05', '2022-04-24 01:35:05');
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `order_system`.`sys_user_role` WRITE;
DELETE FROM `order_system`.`sys_user_role`;
INSERT INTO `order_system`.`sys_user_role` (`user_id`,`role_id`) VALUES (1, 1),(5, 2);
UNLOCK TABLES;
COMMIT;
